// ************************************************************************ //
// The types declared in this file were generated from data read from the
// WSDL File described below:
// WSDL     : F:\MorPromosyon\Sorgu.xml
// Encoding : UTF-8
// Version  : 1.0
// (07.05.2013 05:13:19 - 1.33.2.5)
// ************************************************************************ //

unit PttService;

interface

uses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;

type

  // ************************************************************************ //
  // The following types, referred to in the WSDL document are not being represented
  // in this file. They are either aliases[@] of other types represented or were referred
  // to but never[!] declared in the document. The types from the latter category
  // typically map to predefined/known XML or Borland types; however, they could also
  // indicate incorrect WSDL documents that failed to declare or import a schema type.
  // ************************************************************************ //
  // !:string          - "http://www.w3.org/2001/XMLSchema"
  // !:int             - "http://www.w3.org/2001/XMLSchema"

  OutputDongu          = class;                 { "http://takip.ptt.gov.tr" }



  // ************************************************************************ //
  // Namespace : http://takip.ptt.gov.tr
  // ************************************************************************ //
  OutputDongu = class(TRemotable)
  private
    FIMERK: WideString;
    FISLEM: WideString;
    FITARIH: WideString;
    FsiraNo: Integer;
  published
    property IMERK: WideString read FIMERK write FIMERK;
    property ISLEM: WideString read FISLEM write FISLEM;
    property ITARIH: WideString read FITARIH write FITARIH;
    property siraNo: Integer read FsiraNo write FsiraNo;
  end;

  ArrayOfOutputDongu = array of OutputDongu;    { "http://takip.ptt.gov.tr" }

  // ************************************************************************ //
  // Namespace : http://takip.ptt.gov.tr
  // transport : http://schemas.xmlsoap.org/soap/http
  // style     : document
  // binding   : SorguSoapBinding
  // service   : SorguService
  // port      : Sorgu
  // URL       : http://pttws.ptt.gov.tr/GonderiTakip/services/Sorgu
  // ************************************************************************ //
  Sorgu = interface(IInvokable)
  ['{E108B773-43E0-F666-327E-9CAF5CCD95C5}']
    procedure gonderiSorgu(const barkod: WideString; const kullanici: WideString; const sifre: WideString; out ALICI: WideString; out BARNO: WideString; out DEGKONUCR: WideString; out EKHIZ: WideString; out GONDEREN: WideString; out GONUCR: WideString; out GR: WideString;
                           out IMERK: WideString; out ITARIH: WideString; out ODSARUCR: WideString; out TESALAN: WideString; out VMERK: WideString; out dongu: ArrayOfOutputDongu; out sonucAciklama: WideString; out sonucKodu: Integer); stdcall;
  end;

function GetSorgu(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): Sorgu;


implementation

function GetSorgu(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): Sorgu;
const
  defWSDL = 'F:\MorPromosyon\Sorgu.xml';
  defURL  = 'http://pttws.ptt.gov.tr/GonderiTakip/services/Sorgu';
  defSvc  = 'SorguService';
  defPrt  = 'Sorgu';
var
  RIO: THTTPRIO;
begin
  Result := nil;
  if (Addr = '') then
  begin
    if UseWSDL then
      Addr := defWSDL
    else
      Addr := defURL;
  end;
  if HTTPRIO = nil then
    RIO := THTTPRIO.Create(nil)
  else
    RIO := HTTPRIO;
  try
    Result := (RIO as Sorgu);
    if UseWSDL then
    begin
      RIO.WSDLLocation := Addr;
      RIO.Service := defSvc;
      RIO.Port := defPrt;
    end else
      RIO.URL := Addr;
  finally
    if (Result = nil) and (HTTPRIO = nil) then
      RIO.Free;
  end;
end;


initialization
  InvRegistry.RegisterInterface(TypeInfo(Sorgu), 'http://takip.ptt.gov.tr', 'UTF-8');
  InvRegistry.RegisterDefaultSOAPAction(TypeInfo(Sorgu), '');
  InvRegistry.RegisterInvokeOptions(TypeInfo(Sorgu), ioDocument);
  RemClassRegistry.RegisterXSClass(OutputDongu, 'http://takip.ptt.gov.tr', 'OutputDongu');
  RemClassRegistry.RegisterXSInfo(TypeInfo(ArrayOfOutputDongu), 'http://takip.ptt.gov.tr', 'ArrayOfOutputDongu');

end.
